#include "IfNode.h"
#include "SentenceBlockNode.h"
#include "ExpressionNode.h"

void CIfNode::DebugPrint(int32_t InDepth)
{
    //print depth
    for (int32_t i = 0; i < InDepth; i++)
    {
        WH::Print(U"\t");
    }

    WH::Print(U"if(");
    Condition->DebugPrint(0);
    WH::Print(U")\n");

    //print depth
    for (int32_t i = 0; i < InDepth; i++)
    {
        WH::Print(U"\t");
    }

    WH::Print(U"{\n");

    TrueBranch->DebugPrint(InDepth + 1);

    //print depth
    for (int32_t i = 0; i < InDepth; i++)
    {
        WH::Print(U"\t");
    }

    WH::Print(U"}\n");

    if (FalseBranch)
    {
        //print depth
        for (int32_t i = 0; i < InDepth; i++)
        {
            WH::Print(U"\t");
        }

        WH::Print(U"else\n");

        //print depth
        for (int32_t i = 0; i < InDepth; i++)
        {
            WH::Print(U"\t");
        }

        WH::Print(U"{\n");

        FalseBranch->DebugPrint(InDepth + 1);

        //print depth
        for (int32_t i = 0; i < InDepth; i++)
        {
            WH::Print(U"\t");
        }

        WH::Print(U"}\n");
    }
}
